//
//  UIBarButtonItem+Category.swift
//  BBLinkiOSProject
//
//  Created by liuzhu on 2018/11/10.
//  Copyright © 2018 liuzhu. All rights reserved.
//

import UIKit
extension UIBarButtonItem{
    //类方法
    class func creatBarButtonItem(imageName:String ,target:AnyObject?,action:Selector)->UIBarButtonItem{
        let Btn = UIButton()
        Btn.setImage(UIImage(named: imageName), for: UIControl.State.normal)
        //Btn.setImage(UIImage(named: imageName+"_highlighted"), for: UIControl.State.highlighted)
        Btn.sizeToFit()
        Btn.addTarget(target, action: action, for: UIControl.Event.touchUpInside)
        return UIBarButtonItem(customView: Btn)
    }
}
